import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
   redirect:"/login"
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '@/views/Login.vue')
  },
  {
    path: '/deliver',
    name: 'Deliver',
    component: () => import(/* webpackChunkName: "about" */ '@/components/发货单/Deliver.vue')
  },
  {
    path: '/contact',
    name: 'Contact',
    component: () => import(/* webpackChunkName: "about" */ '@/views/Contact.vue')
  },
  {
    path: '/userfriendly',
    name: 'UserFriendly',
    component: () => import(/* webpackChunkName: "about" */ '@/views/UserFriendly.vue')
  },
  {
    path: '/personalDetails',
    name: 'PersonalDetails',
    component: () => import(/* webpackChunkName: "about" */ '@/components/发货单/PersonalDetails.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/customerDetails/:id',
    name: 'CustomerDetails',
    component: () => import(/* webpackChunkName: "about" */ '@/components/客户/CustomerDetails.vue')
  },
  {
    path: '/thorough/:id',
    name: 'Thorough',
    component: () => import(/* webpackChunkName: "about" */ '@/components/发货单/Thorough.vue')
  },
  {
    path: '/myclients',
    name: 'Myclients',
    component: () => import(/* webpackChunkName: "about" */ '@/views/Myclients.vue')
  },
  {
    path: '/pingfen/:id',
    name: 'Pingfen',
    component: () => import(/* webpackChunkName: "about" */ '@/components/发货单/Pingfen.vue')
  },
  {
    path: '/shangpingxiangqing/:id',
    name: 'Shangpingxiangqing',
    component: () => import(/* webpackChunkName: "about" */ '@/components/发货单/Shangpingxiangqing.vue')
  },
  {
    path: '/kehuxiangqing/:id',
    name: 'Kehuxiangqing',
    component: () => import(/* webpackChunkName: "about" */ '@/components/客户/Kehuxiangqing.vue')
  },
  {
    path: '/xiaoxizhongxi',
    name: 'Xiaoxizhongxi',
    component: () => import(/* webpackChunkName: "about" */ '@/components/消息中心/Xiaoxizhongxi.vue')
  },
  {
    path: '/xiaoxixiangqing/:id',
    name: 'Xiaoxixiangqing',
    component: () => import(/* webpackChunkName: "about" */ '@/components/消息中心/Xiaoxixiangqing.vue')
  },
  {
    path: '/gerenxinxi',
    name: 'Gerenxinxi',
    component: () => import(/* webpackChunkName: "about" */ '@/components/个人中心/Gerenxinxi.vue')
  },
  {
    path: '/kuaitidan',
    name: 'Kuaitidan',
    component: () => import(/* webpackChunkName: "about" */ '@/components/物流单/Kuaitidan.vue')
  },
  {
    path: '/expressOrderEvaluation/:id/:item',
    name: 'ExpressOrderEvaluation',
    component: () => import(/* webpackChunkName: "about" */ '@/components/物流单/ExpressOrderEvaluation.vue')
  },
  {
    path: '/comments/:id',
    name: 'Comments',
    component: () => import(/* webpackChunkName: "about" */ '@/components/物流单/Comments.vue')
  },
  {
    path: '/thecustomertoedit/:id',
    name: 'Thecustomertoedit',
    component: () => import(/* webpackChunkName: "about" */ '@/components/客户/Thecustomertoedit.vue')
  },
  {
    path: '/newcustomerinformation',
    name: 'Newcustomerinformation',
    component: () => import(/* webpackChunkName: "about" */ '@/components/客户/Newcustomerinformation.vue')
  },
  {
    path: '/visitrecord',
    name: 'Visitrecord',
    component: () => import(/* webpackChunkName: "about" */ '@/components/客户关怀/Visitrecord.vue')
  },
  {
    path: '/newvisitinformation',
    name: 'Newvisitinformation',
    component: () => import(/* webpackChunkName: "about" */ '@/components/客户关怀/Newvisitinformation.vue'),
  },
  {
    path: '/selectthecustomer',
    name: 'Selectthecustomer',
    component: () => import(/* webpackChunkName: "about" */ '@/components/客户关怀/Selectthecustomer.vue'),
  },
  {
    path: '/discuss/:id',
    name: 'Discuss',
    component: () => import(/* webpackChunkName: "about" */ '@/components/发货单/Discuss.vue'),
  },
  {
    path: '/visitdetails/:id',
    name: 'Visitdetails',
    component: () => import(/* webpackChunkName: "about" */ '@/components/客户关怀/Visitdetails.vue'),
  },


  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
router.beforeEach((to,from,next)=>{
  console.log(to,from);
  next()
})
export default router